import React from 'react'
import { Button } from 'antd'
import { loginInfo } from '../../utils/consts'

export default function Login(props) {
    // const returnUrl = props.location.search.split('=')[1] || ''
    return (
        <div>
            <h1>登录授权</h1>
            <p>仅做测试</p>
            <Button
                onClick={() => {
                    loginInfo.login()
                    // 1.
                    // returnUrl
                    //     ? props.history.push(returnUrl)
                    //     : props.history.push('/')

                    // 2.
                    props.location.this.state
                        ? props.history.push(props.location.state.from)
                        : props.history.push('/')
                }}
            >登录</Button>
        </div>
    )
}
